package menu;

import javax.microedition.lcdui.*;


/**
 * Cascading Menu design pattern.
 * An example of MDisplayable implementation.
 *
 * @author Ben Hui
 */

public class SampleMenuAction extends TextBox implements MDisplayable
{

  public SampleMenuAction()
  {
    super( "Sample Menu Action", "Sample Content", 40, TextField.ANY );
  }

  /**
   * This method is called when user selected the menu option associated with this MDisplayable. This this
   * object is set into Display for showing on device screen.
   *
   * @param e menu element
   */
  public void onDisplay( MenuElement e )
  {

    this.setString( "You have selected menu item "+e.text );
  }

}